#include<iostream>
using namespace std;
const int INF = 0x3f3f3f3f;
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		int a, b, c;
		int temp = INF;
		for (int i = 2; i * i * i <= n; i++) {
			if (n % i == 0) {
				int x = n / i;
				for (int j = i; j * j <= x; j++) {
					if (x % j == 0 && x / j - i < temp) {
						a = i;
						b = j;
						c = x / j;
						temp = x / j - i;
					}
				}
			}
		}
		if (temp == INF) {
			cout << "No solution" << endl;
		}
		else {
			cout << n << "=" << a << "*" << b << "*" << c << endl;
		}
	}
	return 0;
}